﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;

namespace TcpServer.ThreadManage
{
    class MyThread3
    {
        private static object OLock = new object();

        private string SThread3 = "";
        
        public MyThread3(string s)
        {
            SThread3 = s;
        }

        public void Test1()
        {
            lock (OLock)
            {
                for (int i = 0; i < 3; i++)
                {
                    Console.WriteLine(SThread3+" i="+i.ToString());
                    Thread.Sleep(2000);
                }
                
            }
        }
    }
}
